#ifndef MYUTIL_H
#define MYUTIL_H
#include<iostream>
#include<algorithm>
std::string trim(std::string word){	//去除字符串头尾的空格和标点
	auto beg = find_if(word.begin(), word.end(), [](char ch) {
		return isalpha(ch);
	});
	auto ed = find_if(word.rbegin(), word.rend(), [](char ch) {
		return isalpha(ch);
	});

	word.erase(ed.base(), word.end());
	word.erase(word.begin(), beg);
    return word;
}

std::string tolowerStr(std::string str){	 //将字符串改为全小写以实现大小写不敏感
    std::transform(str.begin(),str.end(),str.begin(),::tolower);
    return str;
}

std::string highlight(const std::string &str){
	return "\033[1;33m" + str + "\033[0m";
}
#endif //MYUTIL_H